package java_objects.nested_class;

public class OuterClass4 {
	class Inner {
		int x;
		static final double PI = 3.14;
		void test1(){
			System.out.println("Non static method");
		}
	}
	public static void main(String[] args) {
		
		// How to reference non static variable
		new OuterClass4().new Inner().x = 10;
		
		// How to reference static final variable
		System.out.println(OuterClass4.Inner.PI);
		
		// How to call NON static method
		new OuterClass4().new Inner().test1();
		
		// How to get a reference to NestedClass instance
		Inner ref = new OuterClass4().new Inner();
		ref.x = 10;
		ref.test1();
	}
}

